import axios from 'axios'

const context = "/admin"


/**************************************************************************************************/
/***
 * 获取 “商品分类” 分页
 */
export function getGoodsCategoryPagination( data:any ) {
   return axios.get(`${context}/omsGoodsCategory/pagination`, { params: data });
}

/***
 * 获取所有 "商品分类" 
 */
export function getGoodsCategoryAllList( data:any ){
    return axios.get(`${context}/omsGoodsCategory/list`, { params: data });
}

/***
 * 新增 "商品分类"
 */
export function addGoodsCategory( data:any ){
    return axios.post(`${context}/omsGoodsCategory`,  data );
}

/***
 * 修改 "商品分类"
 */
export function updateGoodsCategory(data:any ){
    return axios.put(`${context}/omsGoodsCategory`,  data );
}


/***
 * 删除 "商品分类"
 */
export function removeGoodsCategory( data:any ){
    return axios.post(`${context}/omsGoodsCategory/remove`, data);
}

/**************************************************************************************************/
/***
 * 获取商品分页列表
 */
export function getGoodsPagination( data:any ){
    return axios.get(`${context}/omsGoodsInfo/pagination`, { params: data });
}

/***
 * 新增商品
 */
export function addGoodsInfo( data:any ){
    return axios.post(`${context}/omsGoodsInfo`, data);
}

/***
 * 更新商品基本信息
 */
export function updateGoodsInfo( data:any ){
    return axios.put(`${context}/omsGoodsInfo`, data);
}

/***
 * 更新商品产品图
 */
export function updateGoodsProductImgOrVideo( data:any ){
    return axios.put( `${context}/omsGoodsInfo/productImg`, data )
}

/***
 * 更新商品详情图
 */
export function updateGoodsDetailImg( data:any ){
    return axios.put( `${context}/omsGoodsInfo/detailImg`, data )
}


/***
 * 删除商品
 */
export function removeGoodsInfo(  data:any ){
    return axios.post(`${context}/omsGoodsInfo/remove`, data);
}   

/***
 * 商品上架、下架
 */
export function groundingGoodsInfo( data:any ){
    return axios.put(`${context}/omsGoodsInfo/grounding`, data);
}